<?php
session_start();
require_once '../lib/ServicoConsulta.php'; 
require_once '../lib/ServicoPessoa.php';

if (isset($_POST["senha"]))
{
	$usuario = $_REQUEST["usuario"];
	$senha = $_REQUEST["senha"];
	$r = ServicoConsulta::logar($usuario,$senha);
	if ($r=="")
	{	
		$_SESSION["userID"] = $usuario;
		header("location: index.php");
	}else{
		$_SESSION["userID"] = $r;
		header("location: login.php");
	}
}



?>
